<?php
error_reporting("E_ALL");ini_set("display_errors", 1);
$getdata=$_REQUEST;
if(empty($getdata))$getdata=$_POST?$_POST:$_GET;
$type=empty($getdata['type'])?'':$getdata['type'];
include("include/function.php");
//header("content-Type: application/json; charset=utf-8");
$config = include("config.php");
include("include/".$config['DB_TYPE'].".class.php");
$db = new db;
$db->connect($config['DB_HOST'],$config['DB_USER'],$config['DB_PWD'],$config['DB_NAME'], $config['DB_PCONNECT']);
        
$page = empty($getdata['page'])?1:$getdata['page'];
$id = empty($getdata['id'])?0:$getdata['id'];
$length=5000;
$where="`isMuslin` = '1'";	
if($id){
    $where.=" and id>".$id;
}
$orderids=[];
$insert=0;
$sql="select personType,studentUuid,userId from order_info_hs where ".$where.' order by id limit '.$length;
$list = $db->get_all($sql);if(empty($list))exit('over');
$sqlarr=[];
foreach($list as $v){
    if($v['personType']==1){
        $uuid = $v['userId'];
    }else{
        $uuid = $v['studentUuid'];
    }
    if($uuid){
        $sqlarr[]="update hema_student set is_qingzhen='1' where uuid='".$uuid."';";
    }
}
echo implode("\n",$sqlarr);

//echo count($sqlarr)."\n";
//echo implode(";\n",$sqlarr);
?>